<?php

namespace Home\Controller;

class ManageController extends HomeCoreController {
	
    public $Model = null;

    protected function _initialize(){
		
        parent::_initialize();
		
    }
	
	public function index(){
		
		if(IS_AJAX){
							
			$map['provinces'] = session('memberinfo.provinces');
			
			$map['citys'] = session('memberinfo.citys');
			
			$map['countys'] = session('memberinfo.countys');
			
			$map['gid'] = 1;
			
			$page_size = 10;
			
			$count = M('Member')->where($map)->count();
			
			$Page = new \Think\Page($count, $page_size);
			
			$list = M('Member')
				->where($map)
				->order("id desc")
				->limit($Page->firstRow . ',' . $Page->listRows)
				->select();
				
			
			$str = $this->tojson($list, $count);
			
			echo $str;
			
			exit;
			
        }else{
			
            $this->display();
			
        }
		
    }
	
}